import request from '@/utils/request'

export function getDepartment() {
  // 用 axios 发请求
  return request({
    method: 'get',
    url: '/company/department'
  })
}

export function addDepartment(data) {
  // 用 axios 发请求
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}

export function addDepartmentEdit(id) {
  // 用 axios 发请求
  return request({
    method: 'get',
    url: '/company/department/' + id
  })
}

export function updateDepartments(data) {
  // 用 axios 发请求
  return request({
    method: 'put',
    url: '/company/department/' + data.id,
    data
  })
}

export function delDepartment(id) {
  // 用 axios 发请求
  return request({
    method: 'delete',
    url: '/company/department/' + id
  })
}
